<!-- <nz-card>
  <div nz-row nzGutter="8">
    <ng-container *ngIf="queryFieldCount > 4">
      <div nz-col [nzSpan]="_$expand ? 24 : 18">
        <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
      </div>
      <div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right">
        <button nz-button nzType="primary" [nzLoading]="loading" (click)="search()" acl
          [acl-ability]="['SUPPLY-INDEX-bulkSearch']">查询</button>
        <button nz-button nzType="primary" [disabled]="loading" (click)="exportFire()">导出</button>
        <button nz-button [disabled]="loading" (click)="resetSF()">重置</button>
        <button nz-button nzType="link" (click)="expandToggle()">
          {{ !_$expand ? '展开' : '收起' }}
          <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
        </button>
      </div>
    </ng-container>
  </div>
</nz-card> -->
<ng-template #extraTemplate>
  <div>
    <button nz-button nzDanger (click)="openDrawer()" class="mr-sm" [nzLoading]="loading" acl
      [acl-ability]="['SUPPLY-INDEX-bulkSearch']">筛选</button>
    <button nz-button nzDanger [disabled]="loading" (click)="exportFire()">导出</button>
    <button nz-button nz-dropdown [nzDropdownMenu]="menu" nzPlacement="bottomLeft">
      更多<i nz-icon nzType="down" nzTheme="outline"></i></button>
    <nz-dropdown-menu #menu="nzDropdownMenu">
      <ul nz-menu>
        <li nz-menu-item acl [acl-ability]="['SUPPLY-INDEX-bulkBatchAudit']" (click)="audit('', 2)">
          审核
        </li>
        <li nz-menu-item acl [acl-ability]="['SUPPLY-INDEX-bulkUndertakesToSupply']" (click)="releaseGoods()">
          代发货源
        </li>
      </ul>
    </nz-dropdown-menu>
  </div>
</ng-template>
<nz-card class="table-box" style="margin: 0;">
  <div class="tab_header">
    <nz-tabset (nzSelectedIndexChange)="selectChange($event)" [nzTabBarExtraContent]="extraTemplate">
      <nz-tab [nzTitle]="'全部(' + tabs?.totalQuantity + ')'"></nz-tab>
      <nz-tab [nzTitle]="'进行中(' + tabs?.stayQuantity + ')'"></nz-tab>
      <nz-tab [nzTitle]="'已完结(' + tabs?.completedQuantity + ')'"></nz-tab>
      <nz-tab [nzTitle]="'已取消(' + tabs?.cancelQuantity + ')'"></nz-tab>
    </nz-tabset>
  </div>

  <div>
    <div style="position: relative;">
      <nz-alert nzType="info" [nzMessage]="'当前共' + st?.total + '行记录，已选择' + selectedRows.length + '项'" nzShowIcon
        style="margin: 0.5rem 16px;display: block;" class="header_box">
      </nz-alert>
    </div>
    <st #st [scroll]="{ x: '2000px',y:scrollY  }" [data]="service.$api_get_bulkPage_list" [columns]="columns"
      [req]="{  process: beforeReq }"
      [res]="{ reName: { list: 'data.records', total: 'data.total' } , process: afterRes}"
      [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [loading]="false">
      <ng-template st-row="createUserName" let-item let-index="index">
        <div> {{ item?.createUserName }}{{ item?.createUserPhone ? '/' + item?.createUserPhone : ''}} </div>
      </ng-template>
      <!--运费单价  -->
      <ng-template st-row="freightPrice" let-item let-index="index">
        <div class="mr-xs">{{ item?.freightPrice | currency }} </div>
      </ng-template>
      <!--货源编号  -->
      <ng-template st-row="resourceCode" let-item let-index="index">
        <a [routerLink]="'bulk-detail/' + item?.id">{{ item?.resourceCode }}</a>
        <div>{{ item?.resourceTypeLabel }}{{ item?.serviceTypeLabel }}</div>
        <div>{{ item?.resourceStatusLabel === '已完成' ? '已完结' : item?.resourceStatusLabel }}</div>
      </ng-template>
      <!-- 服务类型 -->
      <ng-template st-row="serviceType" let-item let-index="index">
        <div *ngIf="item?.serviceType === 1">抢单</div>
        <div *ngIf="item?.serviceType === 2">指派</div>
      </ng-template>
      <!-- 关联订单 -->
      <ng-template st-row="orderSn" let-item let-index="index">
        <div *ngFor="let item of item?.wayBillClassifiedStatisticsVOList">
          <label>{{ item?.wayBillStatusLabel }}</label>
          (<span [ngStyle]="{ color: item?.count > 0 ? '#1890FF' : '' }">{{ item?.count }}</span>)
        </div>
      </ng-template>
      <!-- 货物信息 -->
      <ng-template st-row="goodsInfos" let-item let-index="index">
        <div>{{ item?.goodsInfos?.goodsName }}</div>
        <div>货源：{{ item?.goodsInfos?.goodsResource }}</div>
        <div class="text-error-dark">剩余: {{ item?.goodsInfos?.remainingAmount }}</div>
      </ng-template>
      <!-- 用车需求 -->
      <ng-template st-row="useCarDemand" let-item let-index="index">
        <div>车型: {{ item?.carModelLabel }}</div>
        <div class="error">车长: {{ item?.carLengthLabel }} 米</div>
      </ng-template>
    </st>
  </div>
</nz-card>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" nzTitle="货源审核"
  (nzOnCancel)="handleCancel('suppliersType')">
  <ng-container *nzModalContent>
    <div style="position: relative" *ngIf="auditMany">
      <nz-alert nzType="info" [nzMessage]="'已选择' + selectedRows?.length + '项'" nzShowIcon
        [ngStyle]="{ margin: '0 0 1rem 0' }">
      </nz-alert>
    </div>
    <sf #sfFre [schema]="freightSchema" [ui]="ui2" [compact]="false" [button]="'none'"> </sf>
  </ng-container>
  <ng-template #nzModalFooter>
    <button nz-button nzType="primary" (click)="handleOK(1)">通过</button>
    <button nz-button nzType="default" (click)="handleOK(2)">不通过</button>
  </ng-template>
</nz-modal>
<!-- <ng-template #extraTemplate>
  <div>
    <button (click)="audit('',2)" nz-button nzType="primary">批量审核</button>
    <button (click)="audit('')" nz-button nzType="primary">发布货源</button>
  </div>
</ng-template> -->